﻿@using GrainManage.Web.Resources
@model HandleErrorInfo
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Error</title>
    <style type="text/css">
        table caption {
            font-size: x-large;
            color: red;
        }
    </style>
</head>
<body>
    @{
        var builder = new System.Text.StringBuilder();
        if (Model != null && Model.Exception != null)
        {
            var e = Model.Exception;
            if (!string.IsNullOrEmpty(e.Message))
            {
                builder.AppendLine("Message: " + e.Message);
            }
            if (!string.IsNullOrEmpty(e.Source))
            {
                builder.AppendLine("Source: " + e.Source);
            }
            if (e.TargetSite != null)
            {
                builder.AppendLine("TargetSite: " + e.TargetSite.DeclaringType.FullName + "." + e.TargetSite.Name);
            }
            if (!string.IsNullOrEmpty(e.StackTrace))
            {
                builder.AppendLine("StackTrace:");
                builder.AppendLine(e.StackTrace);
            }
            if (e.InnerException != null && string.IsNullOrEmpty(e.InnerException.Message))
            {
                builder.AppendLine("InnerException Message: " + e.InnerException.Message);
            }
        }
        else
        {
            builder.Append("Can not get Exception");
        }
    }
    <table>
        <caption>Error</caption>
        <tr>
            <td>@GlobalResx.RequestUrl :</td>
            <td>@Request.RawUrl</td>
        </tr>
        <tr>
            <td>@GlobalResx.RequestType :</td>
            <td>@Request.RequestType</td>
        </tr>
        <tr>
            <td>@GlobalResx.StatusCode :</td>
            <td>@Model.StatusCode</td>
        </tr>
        <tr>
            <td>@GlobalResx.Message</td>
            <td>@Model.Message</td>
        </tr>
        <tr>
            <td>@GlobalResx.Exception</td>
            <td>
                <pre>@builder.ToString()</pre>
            </td>
        </tr>
    </table>
</body>
</html>
